<?php

use yii\db\Migration;

/**
 * Handles the creation of table `receive`.
 */
class m180916_081319_create_receive_table extends Migration
{
    public $tableName = '{{%receive}}';
    /**
     * {@inheritdoc}
     */
    public function safeUp()
    {
        $this->createTable($this->tableName, [
            'receive_id' => $this->primaryKey(),
            'name' => $this->string(255)->notNull()->defaultValue('')->comment('姓名'),
            'mobile' => $this->string(255)->notNull()->defaultValue('')->comment('手机号'),
            'money' => $this->decimal(5,2)->notNull()->defaultValue('0.00')->comment('领取金额'),
            'security_sn' => $this->string(255)->notNull()->comment('防伪码'),
            'identity_code' => $this->string(255)->notNull()->comment('身份码'),
            'created_at' => $this->integer(11)->notNull()->defaultValue(0)->comment('领取时间'),
        ]);
    }

    /**
     * {@inheritdoc}
     */
    public function safeDown()
    {
        $this->dropTable($this->tableName);
    }
}
